/*
 * Copyright (c) 2010, Nikolaus Moll
 * All rights reserved.
 */
package net.miblounge.gradecalculator.gui.dialogs;

import net.miblounge.gradecalculator.core.AdaptedRegulations;
import net.miblounge.gradecalculator.core.descriptors.courses.Course;
import net.miblounge.gradecalculator.core.descriptors.courses.CourseDescription;
import net.miblounge.gradecalculator.core.descriptors.courses.IndividualCourse;

import com.trolltech.qt.gui.QWidget;

public abstract class ResultDialogFactory
{
    private ResultDialogFactory()
    {}

    public static AbstractResultDialog create(final QWidget parent, final AdaptedRegulations regulations,
            final Course course)
    {
        if (course instanceof CourseDescription) {
            return new IndividualModuleResultDialog(parent, regulations, (CourseDescription) course);
        }
        if (course instanceof IndividualCourse) {
            return new IndividualCourseResultDialog(parent, regulations, (IndividualCourse) course);
        }
        else {
            return new ResultDialog(parent, regulations, course);
        }
    }
}
